package com.hzit.cart.client;

import com.hzit.common.utils.R;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
@Component
public class UserClientFallBackFactory implements FallbackFactory<UserClient> {

	@Override
	public UserClient create(Throwable cause) {
		return new UserClient() {
			@Override
			public R list() {
				return R.error("list-->出现了调用异常！【FallBackFactory】");
			}

			@Override
			public R findById(String id) {
				 return R.error("findById-->出现了调用异常！【FallBackFactory】");
			}
		};
	}
}
